{% extends "master/layout.html" %}
{% block content %}
        <div class="content">
        {% block formTitle %}
            <form method="post" action="/cmdb/index/table/user/update/userid={{userid}}">
        {% endblock %}
            <div class="container-fluid">
                <div class="row">
                    <div class="col-md-12">
                        <div class="card p-4">
                            <div class="card-header bg-light">
                                更新用户<label style="color: red;">{{ status }}</label>
                            </div>

                            <div class="card-body">


                                    <div class="col-md-7">
                                        <div class="form-group">
                                            {% for item in username %}
                                            <label for="username" class="form-control-label require">用户名</label>
                                            <input type="text" id="username" class="form-control" placeholder="用户名" name="username" value={{ item.username }}>
                                            {% endfor %}
                                        </div>
                                    </div>

                                    <div class="col-md-7">
                                        <div class="form-group">
                                            {% for item in password %}
                                            <label for="password" class="form-control-label require">密码</label>
                                            <input type="password" id="password" class="form-control" placeholder="密码" name="password" value={{ item.password }}>
                                            {% endfor %}
                                        </div>
                                    </div>

                                    <div class="col-md-7">
                                        <div class="form-group">
                                            {% for item in email %}
                                            <label for="email" class="require">邮箱</label>
                                            <input type="email" id="email" class="form-control" placeholder="邮箱" name="email" value={{ item.email }}>
                                            {% endfor %}
                                        </div>
                                    </div>

                                    <div class="col-md-7">
                                        <div class="form-group">
                                            <label for="single-select-2" class="require">用户类型</label>
                                            <select id="single-select-2" class="form-control" name="usertype">
                                                {% for item in usertype_selected %}
                                                <option value={{item.id}}>{{item.name}}</option>
                                                {% endfor %}
                                                {% for item in usertype %}
                                                <option value={{item.id}}>{{item.name}}</option>
                                                {% endfor %}
                                            </select>
                                        </div>
                                    </div>

                                    <div class="col-md-7">
                                        <div class="form-group">
                                            <label for="single-select" class="require">用户组</label>
                                            <select id="single-select" class="form-control" name="group">
                                                {% for item in group_selected %}
                                                <option value={{item.id}}>{{item.name}}</option>
                                                {% endfor %}
                                                {% for item in group %}
                                                <option value={{item.id}}>{{item.name}}</option>
                                                {% endfor %}
                                            </select>
                                        </div>
                                    </div>

                                    <!--
                                    <div class="col-md-7">
                                        <div class="form-group">
                                            <label for="multi-select">用户组</label>
                                            <select id="multi-select" class="form-control" multiple="">
                                                <option>1</option>
                                                <option>2</option>
                                                <option>3</option>
                                                <option>4</option>
                                                <option>5</option>
                                            </select>
                                        </div>
                                    </div>-->

                                    <div class="col-md-7">
                                        <div class="form-group">
                                            <label for="textarea">备注</label>
                                            {% for item in memo %}
                                            <textarea id="textarea" class="form-control" rows="6" name="memo">{{item.memo}}</textarea>
                                            {% endfor %}
                                        </div>
                                    </div>

                            </div>

                            <div class="card-footer p-4">
                                <div class="row">
                                    <div class="col-5">
                                        <button type="submit" class="btn btn-primary px-5">更新</button>
                                    </div>
                                    <div class="col-5">
                                        <a href="/cmdb/index/table/user/" class="btn btn-outline-primary px-5">取消</a>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        {% block formFooter %}
            </form>
        {% endblock %}
        </div>
{% endblock %}
{% block javascript %}
    <script>
    </script>
{% endblock %}